<?php defined('BASEPATH') OR exit('No direct script access allowed');
require APPPATH.'/libraries/REST_Controller.php';

class transaction extends REST_Controller
{     
	function get_transaction_by_id_get()
	{
		if(!$this->get('transaction_id')) {
			$this->response(array('status'=>"false",
					'message' => 'transaction_id not provided'), 200);
		}
		$this->load->model('transactiondao');
		$success = $this->transactiondao->getbyid($this->get('transaction_id'));
		$this->response(array('transaction'=>$success,'status'=> $success ? 'true' : 'false'), 200);
	}

	function get_transactions_get()
	{
		$this->load->model('transactiondao');
		$success = $this->transactiondao->get_all();
		$this->response(array('transactions'=>$success,'status'=> $success ? 'true' : 'false'), 200);
	}	
}
?>